namespace JanusLibAing.EventsArg
{
    using Conditions;

    public class ExecutionCompletedEventArgs : ActionEventArgs
    {
        /// <summary>
        /// exit code
        /// </summary>
        private DefaultExitCondition.EExitCode exitCode = DefaultExitCondition.EExitCode.EXIT_OK;

        /// <summary>
        /// execution was cancelled over exception
        /// </summary>
        private readonly System.Exception exception = null;

        /// <summary>
        /// execution was cancelled
        /// </summary>
        private readonly bool cancelled = false;

        public ExecutionCompletedEventArgs(int actionId, DefaultExitCondition.EExitCode exitCode, System.Exception exception, bool cancelled)
            : base(actionId)
        {
            this.cancelled = cancelled;
            this.exception = exception;
            this.exitCode = exitCode;
        }

        public DefaultExitCondition.EExitCode ExitCode
        {
            get
            {
                return exitCode;
            }
        }

        public System.Exception Exception
        {
            get
            {
                return exception;
            }
        }

        public bool Cancelled
        {
            get
            {
                return cancelled;
            }
        }
    }
}